<?php $sessao = new Zend_Session_Namespace('Parametros'); ?>
<html lang="pt-br">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
    <link href="<?php echo $this->urlbase?>/public/media/css/relatorio_aluno.css" media="screen,print" rel="stylesheet" type="text/css">
</head>
<body>
    <div class="pagina">
        <div class="titulo_relatorio">
            <div class="t_r_txt">Relatório Simulados</div>
            <img class="t_r_logo" src="<?php echo $this->urlbase.'/public/media/images/logo_rel.png'; ?>" />
        </div>
        <table>
            <tr>
                <th align="right">Aluno: </th>
                <th align="left"><?php echo $this->aluno['ALU_NOM'];?></th>
            </tr> 
            <tr>
                <th align="right">Curso: </th>
                <th align="left"><?php echo dominio::getTurma($this->aluno['CUR_ID'],0);?></th>
            </tr>
        </table>   
        <br>
        <table>
            <tr>
                <th align="center">Data</th>
                <th align="center">Simulado</th>
                <th align="center">Questões</th>
                <th align="center">Acertos</th>
                <th align="center">Nota</th>
            </tr> 
            <?php foreach($this->result as $row){ 
                $query = 'SELECT SQL_CACHE * FROM  PUBSIM_RANALU '
                        .' WHERE PLS_ID = '.$row['PLS_ID']
                        .' AND ALU_ID = ' . $this->ALU_ID;
                $res = $this->db->fetchRow($query);
            ?>
            <tr>
                <td align="center"><?php echo Datetools::amd_dma($row['PLS_DATRES']); ?></td>
                <td align="center"><?php echo $row['PLS_NOM']; ?></td>
                <td align="center"><?php echo $res['PLA_TOT']; ?></td>
                <td align="center"><?php echo $res['PLA_ACR']; ?></td>
                <td align="center"><?php 
                    if($row['PSA_STA'] == 1) echo $res['PLA_POR']; 
                    else echo dominio::getStaListaSimuladoAluno($row['PSA_STA']);
                ?></td>  
            </tr>
            <?php } ?>
        </table>
        <br>
    </div>
<script>  
window.print(); 
</script>

<body>
</html>
